package com.iman.manjusri.mappers;

import com.iman.manjusri.mappers.models.DrmBuyOrderDetail;
import com.iman.manjusri.mappers.models.DrmBuyOrderDetailExample;
import com.iman.manjusri.mappers.models.DrmBuyOrderDetailKey;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface DrmBuyOrderDetailMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_order_detail
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    int countByExample(DrmBuyOrderDetailExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_order_detail
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    int deleteByExample(DrmBuyOrderDetailExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_order_detail
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    @Delete({
        "delete from drm_buy_order_detail",
        "where course_id = #{courseId,jdbcType=BIGINT}",
          "and order_id = #{orderId,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(DrmBuyOrderDetailKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_order_detail
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    @Insert({
        "insert into drm_buy_order_detail (course_id, order_id, ",
        "create_dt, cart_id)",
        "values (#{courseId,jdbcType=BIGINT}, #{orderId,jdbcType=VARCHAR}, ",
        "#{createDt,jdbcType=TIMESTAMP}, #{cartId,jdbcType=BIGINT})"
    })
    int insert(DrmBuyOrderDetail record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_order_detail
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    int insertSelective(DrmBuyOrderDetail record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_order_detail
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    List<DrmBuyOrderDetail> selectByExample(DrmBuyOrderDetailExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_order_detail
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    @Select({
        "select",
        "course_id, order_id, create_dt, cart_id",
        "from drm_buy_order_detail",
        "where course_id = #{courseId,jdbcType=BIGINT}",
          "and order_id = #{orderId,jdbcType=VARCHAR}"
    })
    @ResultMap("BaseResultMap")
    DrmBuyOrderDetail selectByPrimaryKey(DrmBuyOrderDetailKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_order_detail
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    int updateByExampleSelective(@Param("record") DrmBuyOrderDetail record, @Param("example") DrmBuyOrderDetailExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_order_detail
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    int updateByExample(@Param("record") DrmBuyOrderDetail record, @Param("example") DrmBuyOrderDetailExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_order_detail
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    int updateByPrimaryKeySelective(DrmBuyOrderDetail record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_buy_order_detail
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    @Update({
        "update drm_buy_order_detail",
        "set create_dt = #{createDt,jdbcType=TIMESTAMP},",
          "cart_id = #{cartId,jdbcType=BIGINT}",
        "where course_id = #{courseId,jdbcType=BIGINT}",
          "and order_id = #{orderId,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(DrmBuyOrderDetail record);
}